//
//  SopViewCell.m
//  DigiOps
//
//  Created by app on 2018/7/18.
//  Copyright © 2018年 俞渊华. All rights reserved.
//

#import "SopTextViewCell.h"

@implementation SopTextViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
//    [self.sopInfo setBackgroundImage:[UIImage imageNamed:@"sop_info"] forState:UIControlStateNormal];
//    [self.sopInfo addTarget:self action:@selector(infoClick) forControlEvents:UIControlEventTouchUpInside];
    [self.okButton addTarget:self action:@selector(infoClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.notokButton addTarget:self action:@selector(infoClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.okButton setBackgroundColor:XMColor(241, 245, 247)];
    [self.notokButton setBackgroundColor:XMColor(241, 245, 247)];
    [self.textField setBackgroundColor:XMColor(241, 245, 247)];
    UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureRecognizer)];
    [self addGestureRecognizer:tapGesture];
//    self.textField.userInteractionEnabled=NO;
    self.textField.delegate=self;
}
-(void)infoClick:(UIButton*)sender
{
    [sender setBackgroundColor:DGColor];
}
-(void)tapGestureRecognizer{
    if (self.block) {
        self.block();
    }
}
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
    //写你要实现的：页面跳转的相关代码
    [self tapGestureRecognizer];
    return NO;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (SopTextViewCell *)cellWithTableView:(UITableView *)tableView {
    static NSString *ID = @"SopTextViewCellID";
    
    SopTextViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[NSBundle mainBundle] loadNibNamed:@"SopTextViewCell" owner:nil options:nil].lastObject;
        cell.backgroundColor=[UIColor whiteColor];
        
    }
    return cell;
}
@end
